/*


import 链式栈.LinkStack;

import java.util.Stack;

public static void main(String[] args) {

}
public static int calculate(String s) throws Exception {
    LinkStack stack =new LinkStack();
    char preSign = '+';
    int num = 0;
    int n = s.length();
    for (int i = 0; i < n; ++i) {
        if (Character.isDigit(s.charAt(i))) {
            num = num * 10 + s.charAt(i) - '0';//获取运算符之外的数字，如果有10以上数，则num*10确保不出错
        }
        //如果是运算符，不包括空格
        if (!Character.isDigit(s.charAt(i)) && s.charAt(i) != ' ' || i == n - 1) {
            switch (preSign) {
                case '+':
                    stack.push(num);
                    break;
                case '-':
                    stack.push(-num);
                    break;
                case '*':
                    stack.push((int)stack.pop() * num);
                    break;
                default:
                    stack.push((int)stack.pop() / num);
            }
            preSign = s.charAt(i);
            num = 0;
        }
    }
    int ans = 0;
    while (!stack.isEmpty()) {
        ans += (int)stack.pop();
    }
    return ans;
}

*/
